import Vue from 'vue'
import { 
  Icon, 
  Button, 
  Field, 
  CellGroup, Cell, 
  Popup,
  Picker, 
  DatetimePicker, 
  Toast, Dialog,
  Progress, 
  Slider, 
  Circle, 
  Card, 
  Empty,
  Tab, Tabs,
  NumberKeyboard,
  SwipeCell,
  Checkbox,CheckboxGroup,
  Radio,RadioGroup,
  Divider,
} from 'vant'

Vue.use(Icon)
.use(Button)
.use(Field)
.use(CellGroup).use(Cell)
.use(Popup)
.use(Picker)
.use(DatetimePicker)
.use(Toast).use(Dialog)
.use(Progress)
.use(Slider)
.use(Circle)
.use(Card)
.use(Empty)
.use(Tab).use(Tabs)
.use(NumberKeyboard)
.use(SwipeCell)
.use(Checkbox).use(CheckboxGroup)
.use(Radio).use(RadioGroup)
.use(Divider)


// 封装 rem + js 移动端适配方案
export function autoSize() {
    //设计稿的宽度
    var psdWidth = 750;
  
    //预设字体值
    var preFontSize = 32;
  
    //当前屏幕宽度
    var curScreenWidth = window.screen.width;
    //当前屏幕对应的html字体值
    var curFontSize = (curScreenWidth * preFontSize) / psdWidth;
  
    //设备宽度在750px 
    if (curScreenWidth > 750) {
      curScreenWidth = 750;
    }
    //把计算下来的当前屏幕html字体值 赋值给html元素 documentElement属性会获取到html根元素 然后为之设置字体值
    document.documentElement.style.fontSize = curFontSize + "px";
  }
  